package gat.common.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 *  通知对象类型
 * @author
 * @date 2022/6/20
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum NotificationTypeEnums {

    ALL("all", "所有用户"),
    VIP("vip", "普通会员"),
    SVIP("svip", "超级会员"),


    ;

    private String code;

    private String value;

    @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
    public static NotificationTypeEnums getByCode(@JsonProperty("code") String code) {
        for (NotificationTypeEnums value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
